﻿using System;
using System.ComponentModel;

namespace SocialKit.LightRest
{
    /// <summary>
    /// Provides http response and exception data if have for RestClient.SendAsyncCompleted event.
    /// </summary>
    public class SendAsyncCompletedEventArgs : AsyncCompletedEventArgs
    {
        /// <summary>
        /// Gets the http response message.
        /// </summary>
        public HttpResponseMessage Response { get; private set; }

        /// <summary>
        /// Initializes a new instance of a SocialKit.LightRest.SendAsyncCompletedEventArgs class.
        /// </summary>
        /// <param name="response">The http response message.</param>
        /// <param name="error">Any error that occurred during the asynchronous operation.</param>
        /// <param name="userState">User specified unique identifier for the asynchronous task.</param>
        public SendAsyncCompletedEventArgs(HttpResponseMessage response, Exception error, object userState) :
            base(error, false, userState)
        {
            this.Response = response;
        }
    }
}